<template>
	<view>
		<!-- 我的房子 -->
		<view class="heighly">
			<view v-if="dataList.length">
				<view class="m-card u-m-30" v-for="(item,index) in dataList" :key="index"
					@click="nextNav('/pages/mine/xiangxi?id=' + item.id+'&type='+type)">
					<view class="u-m-t-20">
						<view class="u-flex u-flex-items-stretch u-font-24">
							<!-- <u-icon size="100"
								:name="item.images.split(',')[index]">
							</u-icon> -->
							<u-image width="100" height="100" :src="item.images.split(',')[0]" mode="aspectFit">
							</u-image>
							<view class="u-m-l-40 u-flex u-flex-wrap u-flex-items-center">
								<view class="m-font-b u-font-32 w_100">{{item.properties_name}}</view>
								<view class="list-text w_100">
									<text>{{item.bedroom}}室{{item.room}}厅/{{item.area}}m²</text>
									<text>/{{item.orientation}}</text>
								</view>
								<view class="u-flex" v-if="item.characteristic">
									<view class="boxch" v-for="(it,ind) in JSON.parse(item.characteristic)" :key='ind'>
										{{it.name}}
									</view>
									<view class="boxch u-m-l-10">
										{{item.roomnature}}
									</view>
								</view>
								<view class="u-flex u-flex-between w_100 m-font-b">
									<view class="u-warning-dark u-font-24">¥{{get_look_two(item.price/1)}}</view>
									<view
										:class="item.examinedata==0?'u-info':item.examinedata==2?'u-warning-dark':'u-success-dark'">
										{{item.examinedata==0?'审核中':item.examinedata==2?'审核不通过':'已发布'}}
									</view>
								</view>
							</view>
						</view>
						<!-- <view class="u-flex u-m-t-20">
							<u--image :src="oss + '/mine/re.png'" width="15"
								height="15"></u--image>
							<text class="m-c-h u-m-l-10">房源热度</text>
						</view>
						<view class="u-p-t-25">
							<u-grid :col="4">
								<u-grid-item v-for="(items, ixd) in recom" :key="ixd" @click="nextNav(item.url)">
									<text class="bepad">{{ items.shu }}</text>
									<view class="m-c-b u-m-t-20 u-font-23">{{ items.name }}</view>
								</u-grid-item>
							</u-grid>
						</view> -->
					</view>
				</view>
			</view>
			<list-empty v-else text="暂时没有数据哟!" list="data" :listHighly="highly"></list-empty>
		</view>

		<u-back-top :scrollTop="pagescrollTop" top="200"></u-back-top>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [],
				recom: [{
						shu: 0,
						name: '浏览量',
						url: ''
					},
					{
						shu: 0,
						name: '关注量',
						url: ''
					},
					{
						shu: 0,
						name: '查看量',
						url: ''
					},
					{
						shu: 0,
						name: '咨询量',
						url: ''
					}
				],
				type: 0
			}
		},
		async onLoad(e) {
			if (e) {
				this.type = +e.type;
			}
			await this.getList();
		},
		async onShow() {
			await this.getList();
		},
		methods: {
			async getList() {
				this.params = {
					...this.params,
					pnum: this.pnum,
				};
				let res = await this.require('getHouse', this.params);
				if (res) {
					this.dataList = res;
					for (var i = 0; i < this.dataList.length; i++) {
						let looknum = this.dataList[i].looknum
						this.recom[0].shu = looknum
						let follownum = this.dataList[i].follownum
						this.recom[1].shu = follownum
						let seenum = this.dataList[i].seenum
						this.recom[2].shu = seenum
						let consultnum = this.dataList[i].consultnum
						this.recom[3].shu = consultnum
					}
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.bepad {
		font-size: 40rpx;
		font-weight: bold;
		color: #2c2a2b;
	}

	// .u-warning-dark-bgs {
	// 	width: 190rpx;
	// 	height: 32rpx;
	// 	display: flex;
	// 	align-items: center;
	// 	justify-content: center;
	// 	background-color: $u-warning-dark;
	// 	color: #fff;
	// }

	.l-h-g {
		line-height: 65rpx;
	}

	.boxch {
		padding: 8rpx;
		text-align: center;
		background: rgba(218, 175, 127, .4);
		border-radius: 5rpx;
		color: #DAAF7F;
	}
</style>
